package org.bees.cms.web.util.velocity.element;

import net.sf.json.JSONObject;

public class Button extends AbstractElement {
	private static final long serialVersionUID = 6181455947957267217L;

	private String type = "button";
	private String text = "";
	private String title = "";
	private String onclick = "";

	@Override
	public void from(JSONObject t) throws Exception {
		super.from(t);
		type = t.containsKey("type") ? t.getString("type") : type;
		text = t.containsKey("text") ? t.getString("text") : text;
		title = t.containsKey("title") ? t.getString("title") : title;
		onclick = t.containsKey("onclick") ? t.getString("onclick") : onclick;
	}

	@Override
	public JSONObject to() throws Exception {
		return super.to();
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getOnclick() {
		return onclick;
	}

	public void setOnclick(String onclick) {
		this.onclick = onclick;
	}

}